﻿using System;
using System.Web.Configuration;

namespace VioletDevelopmentLaboratory.Net.Web.Configuration
{
	public sealed class TraceSectionManager : ConfigurationManagerBase
	{
		private TraceSection section;

		public TraceSectionManager()
		{
			this.section = (TraceSection)base.GetConfigurationSection("system.web/trace");
		}

		public void Modify(bool enabled, bool localOnly, bool mostRecent, bool pageOutput, int requestLimit, TraceDisplayMode traceMode, bool writeToDiagnosticsTrace)
		{
			this.section.Enabled = enabled;
			this.section.LocalOnly = localOnly;
			this.section.MostRecent = mostRecent;
			this.section.PageOutput = pageOutput;
			this.section.RequestLimit = requestLimit;
			this.section.TraceMode = traceMode;
			this.section.WriteToDiagnosticsTrace = writeToDiagnosticsTrace;
			this.Save();
		}
		public TraceSection GetTrace()
		{
			return this.section;
		}
	}
}
